<template>
  <div class="box">
    <el-empty description="Dashboard"></el-empty>
  </div>
</template>

<script>
import ActivityEditor from './components/ActivityEditor.vue';

export default {
  components: { ActivityEditor },
  name: 'Dashboard',
  data() {
    return {
      searchText: '',
      size: 10,
      page: 1,
      actList: [{}],
      orderKey: '',
      order: '',
      isEditorVisible: false,
    };
  },
  mounted() {
  },
  methods: {
    onSearchClick() {
      console.log(this.searchText);
    },
    onActivityAdd() {
      this.isEditorVisible = true;
    },
    onActivityReview(index, activity) {},
    onActivityEdit(index, activity) {},
    onActivityDelete(index, activity) {},
    onSortChange({column, prop, order}) {
      console.log(column);
      console.log(prop);
      console.log(order);
      this.orderKey = prop;
      this.order = order;
    },
    //dialog完成创建的回调
    onActivityCreated(ifNew) {
      console.log(ifNew);
      this.isEditorVisible = false;
    },
    fetchActivetyList(page) {
      return this.request({
        url: '/act/list',
        method: 'get',
        params: {
          page: page,
          size: this.size,
          search: this.searchText,
          orderKey: this.orderKey,
          order: this.order
        }
      }).then((res) => {
        console.log(res);
        //如果page==1则清空旧数据
        this.page = page;
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.box {
  margin: 30px;
}
</style>
